
exports.qustionAnswerSearch = function(req,res) {

    //获取restful参数
    var restfulParams = req.routeInfo.restfulParams;

    //最终结果
    var resultData = [];

    var skip  = restfulParams.skip  == undefined ? 0 : restfulParams.skip;
    var limit = restfulParams.limit == undefined ? config.publicConfig.LIMIT : restfulParams.limit;

    //任务流创建
    async.waterfall([

        //查询问题列表
        function(cb){

            R.SEND_HTTP(
                req,
                {
                    url    : CORE_APIConfig.coreAPI.searchForumContentAndUserInfo + "/skip/" + skip + "/limit/" + limit + "/fc_type/0",
                    method : 'POST'
                },
                function (err, data) {
                    //判断是否有错误信息
                    if (err) {
                        return cb(err, data);
                    }

                    resultData = data.data;


                    cb();
                }
            );
        },

        function(cb){

            for(var i = 0 ;i<resultData.length;i++){

                 //处理图片数量
                 var imagesArr = resultData[i].fc_images.split("|");
                 resultData[i].imagesData = imagesArr; 
            }

            cb();

        }

        ],function(err, result){

            //返回最终拼接结果
            RES.response(res,true,resultData);

        }
    );

}